树莓派 4B 安装 Ubuntu 20.04 备忘【顺便解决 rosdep update 问题】 | 您所在的位置:网站首页 › ubuntu 树莓派4b › 树莓派 4B 安装 Ubuntu 20.04 备忘【顺便解决 rosdep update 问题】 |
树莓派 4B 安装 Ubuntu 20.04 文章目录 1. 镜像烧录2. 初始配置3. 安装 ROS - noetic3.1 官方流程3.2 rosdep update 网络问题解决,附赠一键配置脚本 1. 镜像烧录直接用官方烧录工具即可,此步略。 rpi4-官网镜像rpi 官方烧录工具 2. 初始配置有网线操作,无网线的操作请查看别的博客,在一台 Ubuntu 20.04 的机器上 SSH 操作树莓派,利用自带的 Remmina 即可,或者直接上屏幕。 换密码,初始用户名和密码都是 ubuntu。 sudo passwd root换源,参考 中科大 - ubuntu-ports 文档 。 sudo nano /etc/apt/sources.list # 替换为下面的 -------------------------------------------------------- # 默认注释了源码仓库,如有需要可自行取消注释 deb https://mirrors.ustc.edu.cn/ubuntu-ports/ focal main restricted universe multiverse # deb-src https://mirrors.ustc.edu.cn/ubuntu-ports/ focal main main restricted universe multiverse deb https://mirrors.ustc.edu.cn/ubuntu-ports/ focal-updates main restricted universe multiverse # deb-src https://mirrors.ustc.edu.cn/ubuntu-ports/ focal-updates main restricted universe multiverse deb https://mirrors.ustc.edu.cn/ubuntu-ports/ focal-backports main restricted universe multiverse # deb-src https://mirrors.ustc.edu.cn/ubuntu-ports/ focal-backports main restricted universe multiverse deb https://mirrors.ustc.edu.cn/ubuntu-ports/ focal-security main restricted universe multiverse # deb-src https://mirrors.ustc.edu.cn/ubuntu-ports/ focal-security main restricted universe multiverse安装桌面环境,如果连显示器,注意电源一定要稳定,电流要足,要不屏幕闪或驱动不起来。 sudo apt-get update sudo apt-get upgrade sudo apt-get install ubuntu-desktop sudo reboot改系统名。 sudo gedit /etc/hostname reboot 3. 安装 ROS - noetic 3.1 官方流程不论是 arm 还是 x86_64 ,只要是 ubuntu 20.04 安装 ROS noetic 的流程都是一样的。以下为 https://wiki.ros.org/noetic/Installation/Ubuntu 直接拷贝的内容。 添加 ROS 镜像源,USTC sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.ustc.edu.cn/ros/ubuntu/ `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list'设置 key sudo apt install curl # if you haven't already installed curl curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -安装 ROS 完全体 sudo apt update sudo apt install ros-noetic-desktop-full添加环境变量,附上国内 oh-my-zsh 的安装方法, oh-my-zsh 国内安装及配置。 # bash echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc source ~/.bashrc # zsh echo "source /opt/ros/noetic/setup.zsh" >> ~/.zshrc source ~/.zshrczsh 开通配符 gedit ~/.zshrc setopt nonomatch #加上这句额外的依赖安装 sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential sudo apt install python3-rosdep sudo rosdep init rosdep update 3.2 rosdep update 网络问题解决,附赠一键配置脚本仍然参考在 18.04 下的解决方案,Ubuntu 18.04 安装 ROS Melodic 中 sudo rosdep init 和 rosdep update 一定能成功的方法,就硬干 准备好离线文件,20.04 noetic 版本已上传至 gitee - noetic_rosdep。 git clone https://gitee.com/jqf_zl/noetic_rosdep.git手动操作步骤,拷贝文件 sudo cp -r ./noetic_rosdep/ /etc/ros/ sudo mkdir -p /etc/ros/rosdep/sources.list.d/ sudo cp ./noetic_rosdep/20-default.list /etc/ros/rosdep/sources.list.d/修改 __init__.py ,noetic 版本是 python3 的位置了~ sudo gedit /usr/lib/python3/dist-packages/rosdistro/__init__.py # 第 68 行 DEFAULT_INDEX_URL = 'file:///etc/ros/noetic_rosdep/index-v4.yaml'继续操作,应该就 OK 了。 rosdep update一键自动配置脚本,该脚本将自动帮你进行以上步骤,注意使用该脚本会替换你的 __init__.py 文件,也就是 68 行那一句代码。 cd noetic_rosdep ./one_shot_config.sh可能会偶尔出现网络问题,如下所示 ERROR: unable to process source [file:///etc/ros/noetic_rosdep/fuerte.yaml]: Failed to download target platform data for gbpdistro:从这里查最新的 github 地址,试一试更改 Hosts,然后再运行一下 ./one_shot_config.sh 或 rosdep update。 sudo gedit /etc/hosts # 2021-12-02 查询的结果如下 --------------------- raw.githubusercontent.com 185.199.108.133 185.199.109.133 185.199.110.133 185.199.111.133./one_shot_config.sh 正常的输出结果如下: ./one_shot_config.sh do some preparations work. all works done, we are going to rosdep update. reading in sources list data from /etc/ros/rosdep/sources.list.d Hit file:///etc/ros/noetic_rosdep/osx-homebrew.yaml Hit file:///etc/ros/noetic_rosdep/base.yaml Hit file:///etc/ros/noetic_rosdep/python.yaml Hit file:///etc/ros/noetic_rosdep/ruby.yaml Hit file:///etc/ros/noetic_rosdep/fuerte.yaml Query rosdistro index file:///etc/ros/noetic_rosdep/index-v4.yaml Skip end-of-life distro "ardent" Skip end-of-life distro "bouncy" Skip end-of-life distro "crystal" Skip end-of-life distro "dashing" Skip end-of-life distro "eloquent" Add distro "foxy" Add distro "galactic" Skip end-of-life distro "groovy" Skip end-of-life distro "hydro" Skip end-of-life distro "indigo" Skip end-of-life distro "jade" Skip end-of-life distro "kinetic" Skip end-of-life distro "lunar" Add distro "melodic" Add distro "noetic" Add distro "rolling" updated cache in /home/ubuntu/.ros/rosdep/sources.cache另外,在知乎上发现了一个很好的一键操作工具,作者制作了更详尽的脚本,点赞 👍 。 github - https://github.com/RocShi/rostaller知乎 - ROS 1 安装——从手动到自动:以 Ubuntu 18.04 + ROS Melodic 为例 |
CopyRight 2018-2019 实验室设备网 版权所有 |